package com.ecfront.service.impl;

import java.util.List;
import com.ecfront.dao.WebSiteDAO;
import com.ecfront.exception.WebSiteException;
import com.ecfront.pojo.WebSite;
import com.ecfront.service.WebSiteService;

public class WebSiteServiceImpl implements WebSiteService {
	
	private static WebSiteDAO webSiteDao;
	
	public void setWebSiteDao(WebSiteDAO webSiteDao) {
		this.webSiteDao = webSiteDao;
	}
	
	private static WebSite getWebSiteInfo(){
		List<WebSite> webSites = webSiteDao.findAll();
		return webSites.get(0);
	}
	/**
	 * 返回系统SMTP信息
	 * @return SMTP信息
	 */
	public String getSmtpName() throws WebSiteException {
		return getWebSiteInfo().getSmtpName();
	}
	/**
	 * 返回系统SMTP密码
	 * @return SMTP密码
	 */
	public String getSmtpPass() throws WebSiteException {
		return getWebSiteInfo().getSmtpPass();
	}
	/**
	 * 返回信息SMTP服务器
	 * @return SMTP服务器
	 */
	public String getSmtpSerice() throws WebSiteException {
		return getWebSiteInfo().getSmtpService();
	}

}
